﻿Public NotInheritable Class Splash

    Private Sub Splash_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Static called As Boolean = False
        If Not called Then
            e.Cancel = True
            tmrHide.Enabled = True
            called = True
        End If
    End Sub
    Private didLaunch As Boolean = False
    Private Sub Splash_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.F12 AndAlso didLaunch = False Then
            didLaunch = True
            System.Diagnostics.Debugger.Launch()
        End If
    End Sub

    


    Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Set up the dialog text at runtime according to the application's assembly information.  

        

        'Application title
        If My.Application.Info.Title <> "" Then
            ApplicationTitle.Text = My.Application.Info.Title
        Else
            'If the application title is missing, use the application name, without the extension
            ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If

        'Format the version information using the text set into the Version control at design time as the
        '  formatting string.  This allows for effective localization if desired.
        '  Build and revision information could be included by using the following code and changing the 
        '  Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar.  See
        '  String.Format() in Help for more information.
        '
        '    Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)

        Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)

        'Copyright info
        Copyright.Text = My.Application.Info.Copyright

        'lnkCodePlex.LinkColor = Color.FromArgb(Color.CornflowerBlue.ToArgb Xor &HFFFFFF)
    End Sub

    
    

    

    Private Sub tmrHide_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrHide.Tick
        Me.Opacity -= 0.04
        If Me.Opacity <= 0.0 Then
            Me.Close()

        End If
    End Sub

    Private Sub MainLayoutPanel_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MainLayoutPanel.Paint ', DetailsLayoutPanel.Paint
        If e.ClipRectangle.Height = 0 OrElse e.ClipRectangle.Width = 0 Then Return


        Dim brsh As New Drawing2D.LinearGradientBrush(e.ClipRectangle, Color.RoyalBlue, Color.CornflowerBlue, Drawing2D.LinearGradientMode.Horizontal)
        e.Graphics.FillRectangle(brsh, e.ClipRectangle)

    End Sub

    
    Private Sub lnkCodePlex_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkCodePlex.LinkClicked

        LaunchProjectWebsite()

    End Sub
End Class
